package conf

import "github.com/e421083458/golang_common/lib"

type Http struct {
	Addr   string
	Port   string
	Server []string
	Path   []string
}

var HttpConf Http

func GetHttp() {
	conf := &HttpConf
	conf.Addr = lib.GetStringConf("base.http.addr")
	conf.Port = lib.GetStringConf("base.http.port")
	conf.Server = lib.GetStringSliceConf("base.http.server")
	conf.Path = lib.GetStringSliceConf("base.http.path")
}

type Redis struct {
	ProxyList []string
	Password  string
	DB        int
	MaxActive int
	MaxIdle   int
}

var RedisConf Redis

func GetRedis() {
	conf := &RedisConf
	conf.ProxyList = lib.GetStringSliceConf("base.redis.proxy_list")
	conf.Password = lib.GetStringConf("base.redis.password")
	conf.DB = lib.GetIntConf("base.redis.db")
	conf.MaxActive = lib.GetIntConf("base.redis.max_active")
	conf.MaxIdle = lib.GetIntConf("base.redis.max_idle")
}
